home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD024b.dsk
/
CHARGE.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
5KB
|
157 lines
10 REM **********************
20 REM * *
30 REM * CHARGE! *
40 REM * *
50 REM **********************
90 REM
100 GOSUB 6010: DIM SG(5,2): GOTO 7010
1000 REM * CHARGE MOVE ROUTINE *
1010 HP = SQR(XO *XO +YO *YO): IF HP = 0 THEN HP = 1
1020 XO = XO *S0/HP:YO = YO *S0/HP
1030 FOR I = OE TO FV:IM = PEEK(SS):IM = PEEK(SS): NEXT
1040 DRAW TR AT XP,YP
1050 XN = XO:YN = YO
1060 FOR I = ZE TO SL:X = SG(I,ZE) -XP:Y = SG(I,OE) -YP:HP = X *X +Y *Y:XN = XN -CG *SG(I,TW) *X/HP:YN = YN -CG *SG(I,TW) *Y/HP: NEXT
1070 XDRAW TR AT XP,YP:XP = XP +XN:YP = YP +YN
1080 IF XP <ZE OR XP >TN OR YP <ZE OR YP >O9 THEN GOTO 3010
1090 XDRAW TR AT XP,YP: GOTO 1060
2000 REM * DRAW IONS *
2010 HGR : SCALE= OE: ROT= ZE
2020 HPLOT ZE,ZE TO 278,ZE TO 278,159 TO ZE,159 TO ZE,ZE
2030 FOR I = OE TO 13: HPLOT 20 *I,157 TO 20 *I,159: NEXT
2040 FOR I = OE TO 7: HPLOT 276,20 *I TO 278,20 *I: NEXT
2050 HC = FV:SP = TW
2060 PO = -OE:PI = OE
2070 FOR I = OE TO SL
2080 SG(I,ZE) = 2 * INT(125 * RND(1)) +15
2090 SG(I,OE) = 2 * INT(65 * RND(1)) +14
2100 SG(I,TW) = -PI
2110 PI = PI *PO
2120 HC = HC -PI:SP = SP +PI
2130 HCOLOR= HC
2140 DRAW SP AT SG(I,ZE),SG(I,OE)
2150 NEXT
2160 HCOLOR= 7
2170 RETURN
3000 REM * IMPACT SEQUENCE *
3010 IF XP >278 THEN XP = 278: ROT= 48
3020 IF YP >159 THEN YP = 159: ROT= 0
3030 IF XP <0 THEN XP = 0: ROT= 16
3040 IF YP <0 THEN YP = 0: ROT= 32
3050 DRAW FR AT XP,YP: FOR I = OE TO 50:IM = PEEK(SS) - PEEK(SS): NEXT
4000 REM * SCOREKEEPING & WHOSE TURN *
4010 FOR I = OE TO HM
4020 IF I = MC THEN S(I) = S(I) + INT(XP *YP)
4030 NEXT
4040 IF INT(XP *YP) = 0 THEN PRINT : GOTO 4070
4050 GOSUB 8010
4060 HOME
4070 C = C +1
4080 IF C = FV *HM GOTO 5010
4090 IF M = HM THEN IF H = HM THEN H = OE:M = OE:MC = OE: GOSUB 2010: GOTO 7150
4100 IF H = HM THEN M = M +OE:MC = M:H = OE: GOSUB 2010: GOTO 7150
4110 MC = MC +1
4120 H = H +1
4130 IF MC >HM THEN MC = 1
4140 GOTO 7150
5000 REM * ENDING SEQUENCE *
5010 POKE 34,0
5020 HTAB 1: VTAB 24: GOSUB 9060: PRINT "ANOTHER GAME? (Y/N) ";
5030 GET Y$: IF Y$ < >"Y" THEN GOTO 5150
5040 H = 1:M = 1:MC = 1:C = 0
5050 FOR I = OE TO HM:S(I) = ZE: NEXT
5060 VTAB 21: HTAB 1: PRINT SPC( 80)
5070 HOME
5080 VTAB 24: HTAB 1: PRINT "SAME SKILL LEVEL? (Y/N) ";: GET Y$
5090 IF Y$ < >"Y" THEN HOME : VTAB 24: HTAB 1: INPUT "SKILL LEVEL (1-5) ? ";SL
5100 IF SL <OE OR SL >FV GOTO 5090
5110 HOME
5120 VTAB 24: HTAB 1: PRINT "SAME PLAYERS? (Y/N) ";: GET Y$
5130 IF Y$ = "Y" THEN C = 0: GOSUB 2010: GOTO 7140
5140 GOTO 7040
5150 HOME : TEXT : PRINT : PRINT CHR$(4)"RUNMENU"
6000 REM * HEADING *
6010 PRINT CHR$(4);"BLOAD CHARGE SHAPES": POKE 232,0: POKE 233,96
6020 ZE = 0:OE = 1:TW = 2:C = 0:TR = 3:FR = 4:FV = 5:S0 = 10:CG = 25:SS = -16336:TN = 278:O9 = 159
6030 TEXT
6040 FLASH
6050 PRINT "***************************************"
6060 FOR I = OE TO 21: PRINT "*";: HTAB 39: PRINT "*": NEXT
6070 PRINT "***************************************"
6080 NORMAL
6090 GOSUB 9010
6100 VTAB 3: HTAB 15: PRINT "------------";
6110 FOR I = OE TO TR: VTAB TR +I: HTAB 14: PRINT "! !";: NEXT
6120 VTAB 7: HTAB 15: PRINT "------------";
6130 VTAB 5: HTAB 17: PRINT "CHARGE!";
6140 VTAB 14: HTAB 12: PRINT "A GAME FOR UP TO";
6150 VTAB 16: HTAB 14: PRINT "FOUR PLAYERS";
6180 FOR I = 1 TO 3000: NEXT I
6190 RETURN
7000 REM * START INFORMATION *
7010 HOME : HGR
7020 VTAB 22: INPUT "SKILL LEVEL (1-5) > ";SL
7030 IF SL <1 OR SL >5 THEN 7010
7040 GOSUB 2010
7050 HOME : VTAB 22: INPUT "HOW MANY PLAYERS? ";HM
7060 H = 1:M = 1:MC = 1
7070 IF HM <1 OR HM >4 THEN GOTO 7050
7080 FOR I = 1 TO HM
7090 HOME : VTAB 22: INPUT "WHAT'S YOUR NAME? ";NAME$(I)
7100 PRINT : PRINT "HI, ";NAME$(I)
7110 FOR J = 1 TO 1000: NEXT J
7120 HOME
7130 NEXT I
7140 VTAB 21: HTAB 1: PRINT NAME$(1): IF HM >1 THEN VTAB 21: HTAB 20: PRINT NAME$(2): IF HM >2 THEN VTAB 22: HTAB 1: PRINT NAME$(3): IF HM >3 THEN VTAB 22: HTAB 20: PRINT NAME$(4)
7150 XP = 7:YP = 7: POKE 34,23
7160 VTAB 24: HTAB 1: PRINT NAME$(MC);"'S TURN. DIRECTION (X,Y) ";
7170 INPUT XO,YO: GOTO 1010
8000 REM * TICKS UP SCORE *
8010 IF MC = 1 THEN HT = 12:VT = 21
8020 IF MC = 2 THEN HT = 32:VT = 21
8030 IF MC = 3 THEN HT = 12:VT = 22
8040 IF MC = 4 THEN HT = 32:VT = 22
8050 AM = S(MC)
8060 D%(1) = AM/100000:AM = AM -D%(1) *100000
8070 D%(2) = AM/10000:AM = AM -D%(2) *10000
8080 D%(3) = AM/1000:AM = AM -D%(3) *1000
8090 D%(4) = AM/100:AM = AM -D%(4) *100
8100 D%(5) = AM/10:AM = AM -D%(5) *10
8110 D%(6) = AM
8120 FOR J = 6 TO OE STEP -1
8130 FOR I = ZE TO D%(J)
8140 HTAB HT +J: VTAB VT: PRINT I;
8150 IM = PEEK(SS) - PEEK(SS) + PEEK(SS) - PEEK(SS) + PEEK(SS) - PEEK(SS)
8160 NEXT I
8170 NEXT J
8180 RETURN
9000 REM * FANFARE *
9010 FOR I = 0 TO 18
9020 READ X
9030 POKE 768 +I,X
9040 NEXT
9050 DATA 173,48,192,136,208,4,198,1,240,8,202,208,246,166,0,76,0,3,96
9060 S = 768
9070 POKE 1,50
9080 POKE 0,91
9090 CALL S
9100 FOR I = 1 TO 3: NEXT I
9110 POKE 1,33
9120 POKE 0,82
9130 CALL S
9140 FOR I = 1 TO 3: NEXT I
9150 POKE 1,33
9160 POKE 0,75
9170 CALL S
9180 FOR I = 1 TO 3: NEXT I
9190 POKE 1,130
9200 POKE 0,66
9210 CALL S
9220 FOR I = 1 TO 30: NEXT I
9230 POKE 1,50
9240 POKE 0,75
9250 CALL S
9260 POKE 1,255
9270 POKE 0,66
9280 CALL S
9290 RETURN